# -*- coding: utf8 -*-

from puppy.query import QueryFilter
from puppy.model import Query

class ValidatorFilter(QueryFilter):
  """TODO Someone needs to a) explain this, b) implement it."""
  
  def __init__(self, options=""):
    """Constructor for ValidatorFilter."""
    super(ValidatorFilter, self).__init__(options)
    self.info = "Someone needs to a) explain this, b) implement it."
  
    
  def run(self, query):
    """
    Validates a set of query suggestions.
    
    Parameters:
    
    * query (puppy.model.Opensearch.Query): original query
    
    Returns:
    
    * query (puppy.model.Opensearch.Query): validated query
      
    Raises:
    
    * nothing really
    """
    try:
      query.validated = {}
    except:
      print 'Error in QueryValidator: invalid query', query
    return query
  

